package com.dys.testtreeset10;

import java.util.Comparator;

/**
 * @className: com.dys.testtreeset10.Person
 * @description: com.dys.testtreeset10
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/08/08 下午9:25
 */
public class Person {
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}

class BiJiao1 implements Comparator<Person> {

    @Override
    public int compare(Person o1, Person o2) {
        return o1.getAge() - o2.getAge();
    }
}